package com.ssy.lingxi.member.merchant.api.feign.paas;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.MemberConfigQueryVO;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.MemberConfigVO;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.MemberRuleFeignVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
* 会员注册资料接口
* @author 万宁
* @version 2.0.0
* @date 2020-06-08
*/
@FeignClient(name = "merchant-member-service")
public interface MemberConfigControllerFeign {

    /**
     * 新增会员注册资料
     * @param configVO 接口参数
     * @return 会员资料
     */
    @RequestMapping(value = "/paas/member/detail/add", method = RequestMethod.POST)
    Wrapper<MemberConfigQueryVO> addMemberDetail (@RequestBody @Validated(MemberConfigVO.Add.class)  MemberConfigVO configVO);

    /**
     * 修改会员资料
     * @param configVO 接口参数
     * @return 会员资料
     */
    @RequestMapping(value = "/paas/member/detail/update", method = RequestMethod.POST)
    Wrapper<MemberConfigQueryVO> updateMemberDetail (@RequestBody MemberConfigVO configVO);


    /**
     * 更改会员资料配置状态
     * @param configVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/paas/member/detail/status", method = RequestMethod.POST)
    Wrapper<MemberConfigQueryVO> updateMemberDetailStatus (@RequestBody @Validated(MemberConfigVO.UpdateStatus.class) MemberConfigVO configVO);

    /**
     * 删除会员资料配置
     * @param configVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/paas/member/detail/delete", method = RequestMethod.POST)
    Wrapper<?> deleteMemberDetail (@RequestBody @Validated(MemberConfigVO.Delete.class) MemberConfigVO configVO);

    /**
     * 新增或修改平台规则配置
     * @param rules 平台规则
     * @return 操作结果
     */
    @RequestMapping(value = "/paas/member/detail/rules", method = RequestMethod.POST)
    Wrapper<Void> updateOrInsertMemberRules(@RequestBody List<MemberRuleFeignVO> rules);
}
